<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
     String path=request.getContextPath();
     String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=basePath%>esayui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath%>esayui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/jquery-1.11.0.js"></script>
<script type="text/javascript" src="<%=basePath%>esayui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" type="text/css" href="<%=basePath%>esayui/themes/default/easyui.css" >
<link rel="stylesheet" type="text/css" href="<%=basePath%>esayui/themes/icon.css">
<title>计算器</title>
</head>
<body>
输入你想转换的数：<input name="num" class="easyui-textbox" id="num">
<button class="easyui-linkbutton" id="button" onclick="sure()">确定</button>
结果为：<input type="text" name="sum" class="easyui-textbox" id="sum1" >
</body>
<script type="text/javascript">
function sure(){
	var a=$("#num").val();
	var b;
	$.ajax({
		url:'num/zh?a='+a,
		type:'post',
		 async: true,
		success:function(data){
           alert(data)
			$("#sum1").val(data);
		}
	});
	}
</script>
</html>